Skip to main content

Get User

GET /:username

Description

Fetches a user profile by username or user ID. The response is shaped for the authenticated viewer, so follow and privacy-related fields can vary depending on who is requesting it.

Request Parameters

Requires Authentication: true

PATH PARAMS

NameTypeRequiredDescription
usernamestringYesUsername or MongoDB user ID.

Usage Example

await axios.get("https://api.daykeeper.app/johndoe", {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

Success Response

{
"message": "user fetched successfully",
"data": {
"_id": "65cbaab84b9d1cce41e98b60",
"username": "johndoe",
"displayName": "John Doe",
"email": "johndoe@example.com",
"private": false
}
}

Error Response

CodeDescription
401Missing or invalid access token
404User not found
500Server error